<template>
  <a-modal
    title="分类管理"
    :visible="visible"
    width="480px"
    :maskClosable="false"
    @ok="handleOk"
    :footer="null"
    @cancel="visible = false"
  >
  <div class="classification-item" v-for="val in new Array(4).fill(0).map((val,i) => i)" :key="val">
    <a-icon class="classification-icon" type="menu" />
    <span v-if="val !== 3" class="classification-name">分类名称</span>
    <a-input v-else class="classification-name"></a-input>
    <span class="classification-edit">编辑</span>
    <span class="classification-del">删除</span>
  </div>
  <div class="classification-add" @click="addClassification">
    <b-svg type="add" class="icon"></b-svg>
    <span>添加新分类</span>
  </div>
  </a-modal>
</template>

<script>
export default {
  data() {
    return {
      visible: false
    }
  },
  methods: {
    handleOk() {

    },
    show() {
      console.log("我执行了")
      this.visible = true
    },
    addClassification() {

    }
  }
}
</script>

<style lang="less" scoped>
.classification-item{
  display: flex;
  align-items: center;
  .classification-icon{
    margin-top: 1px;
    margin-right: 10px;
  }
  .classification-name{
    display: inline-block;
    width: calc(100% - 120px);
  }
  .classification-edit{
    cursor: pointer;
    padding: 6px 10px;
    // margin-right: auto;
  }
  .classification-del{
    cursor: pointer;
    padding: 6px 10px;
  }
}

.classification-add{
  cursor: pointer;
  height: 33px;
  display: flex;
  align-items: center;
  margin-top: 10px;
  .icon{
    color: #409EFF;
    margin-right: 6px;
  }
}
</style>
